<html>
    <body>

      <?php
	//make connection to server
	$link = mysql_connect('localhost', 'pott0180', 'ckersixt');
	if(!$link) {
		die('Could not connect: ' . mysql_error());
	}

	//select database
	$db_selected = mysql_select_db('soloono_roomFinder', $link);
	if (!$db_selected) {
		die('Cant use db soloono_roomFinder: ' . mysql_error());
	}

        $buildingName=$_GET['Building.value'];
        $roomNum=$_GET['Room.value'];

	//need this query to perform safe sql functions
	$query = sprintf("SELECT * FROM soloono_roomFinder");

	//do the query
	$result = mysql_query($query);
	if(!$result){
		$message = 'Invalid query: ' . mysql_error() . "\n";
		$message = 'Whole query: ' . $query;
		die($message);
	}

	if(!$result) {
		echo "Could not successfully run query ($query) from db: " . mysql_error();
		exit;
	}

	echo "Number of rows in database table = ".mysql_num_rows($result).". <br />";

	while ($row = mysql_fetch_assoc($result)){
		echo 'row '.$row["mykey"].') ';
		echo $row["data"].' ';
		echo $row["data2"].' ';
		echo '<br />';
	}

	//close connection
	mysql_close($link);
?>

<!--

this is my post.php returning values from a database from user input
<html>
	<body>
		< ?php error_reporting(E_ALL ^ E_NOTICE);?>
		Your name is: < ?php echo $_POST['name']; ?><br />
		You believe the answer is: < ?php echo $_POST['question']; ?><br />
		And your thoughts consist of the following: < ?php echo $_POST['thoughts']; ?><br />

	</body>
</html>

//returning info:

//should we store images in a folder, store the location in the database, and call that instead of storing the image
//itself in a blob?

//can this be done applying queries to var's or what?***

The room < ?php echo $_GET['roomNum']." in ".$_GET['buildingName']."<br />"
               echo "is on the ".$_GET['floor']."floor."?>

///some picture stuff
///does every room have its own zoomed in picture? every room have a marker? every room from a floor plan outlined?

if(!isset($id) || empty($id) || !is_int($id)){
     die("No image found.");
}
else{
$query = mysql_query("SELECT * FROM tbl_images WHERE id='".$id."'");    //select blob from table
$row = mysql_fetch_array($query);   //gather info into one variable
$content = $row['image'];           //get blob from table

header('Content-type: image/jpg');  //tells browser and server file is jpg
     echo $content;                 /displays picture
}


------------

possible query for checking db

user chooses building and room.

$buildingName=$_GET['buldingName'];
$roomNum=$_GET['roomNum'];
$query = (SELECT  "$buildingName","$roomNum" FROM Building, Room WHERE "$roomNum" = Room.number, "$buildingName" = Building.name);



-->